package test;

import resoft.jeasyform.event.EventHandler;
import resoft.jeasyform.components.Window;
import resoft.jeasyform.components.Component;
import resoft.jeasyform.core.Session;

import java.util.Map;
import java.util.HashMap;

/**
 * <p></p>
 * User: albert
 * Date: Aug 30, 2007
 * Time: 5:13:51 AM
 */
public class AfterConfirmEvent implements EventHandler {
    public boolean execute(Window window, Component source, int eventType) {
        String userCode = window.getValue("userCode");
        String password = window.getValue("password");
        String org = window.getValue("org");
        window.setMessage("用户名:" + userCode + ";密码:" + password + ";org=" + org + ";orgName:" + window.getComponentAttribute("org","text") );
        window.showMessageBox("SUCCESS!!!");
        window.findComponentByName("password").show();
        window.findComponentByName("org").show();
        //window.waitConfirmation("abc");
        Session.getInstance().set("user",userCode);
        Map params = new HashMap();
        params.put("tool",org);
        //window.close();
        window.openWindow("main",params);
        return false;        
    }
}
